package org.example.flyweight;

import java.util.HashMap;

/**
 * @author wangbin
 * @date 2024/4/18
 * @vesion 1.0
 */
public class WebsiteFactory {
    private HashMap<String,ConcreteWebsite> pool =new HashMap<>();

    public WebSite getWebSiteCategory(String type){
        if(!pool.containsKey(type)){
            pool.put(type,new ConcreteWebsite(type));
        }
        return (WebSite) pool.get(type);
    }

    public int getWebSiteCount(){
        return pool.size();
    }
}
